import 'package:json_annotation/json_annotation.dart';

part 'store_product_query.g.dart';

@JsonSerializable()
class StoreProductQuery {
  final List<Product> productList;

  StoreProductQuery(this.productList);

  factory StoreProductQuery.fromJson(Map<String, dynamic> json) =>
      _$StoreProductQueryFromJson(json);

  Map<String, dynamic> toJson() => _$StoreProductQueryToJson(this);
}

@JsonSerializable()
class Product {
  final int productId;
  final String productName;
  final String productImage;
  final String salePrice;
  final String sellingPrice;
  final int curStoreId;
  final int miaId;
  final String storeAreaNames;
  final DateTime startTime;
  final DateTime endTime;
  final DateTime serverTime;

  Product(
    this.productId,
    this.productName,
    this.productImage,
    this.salePrice,
    this.sellingPrice,
    this.curStoreId,
    this.miaId,
    this.storeAreaNames,
    this.startTime,
    this.endTime,
    this.serverTime,
  );

  factory Product.fromJson(Map<String, dynamic> json) => _$ProductFromJson(json);

  Map<String, dynamic> toJson() => _$ProductToJson(this);
}
